from api import Detector
import os
# Initialize detector
detector = Detector(model_name='rapid',
                    weights_path='./weights/pL1_MWHB1024_Mar11_4000.ckpt')

# A simple example to run on a single image and plt.imshow() it
detector.detect_one(img_path='./images/exhibition.jpg',
                    input_size=1024, conf_thres=0.3,
                    visualize=True)
if False:
    imgs_path = './images'     # 视频保存路径
    for file in os.listdir(imgs_path):
        path = os.path.join(imgs_path,file)
        detector.detect_one(img_path=path,
                            input_size=1024, conf_thres=0.3,
                            visualize=True)

#detector.detect_imgSeq(img_dir='./images/',gt_path='./images/annotations.json',input_size=1080)
